#ifndef B_T_ITERATOR
#define B_T_ITERATOR

#ifndef BINARY_TREE
#define BINARY_TREE
typedef struct TreeNode TNode;
struct TreeNode {
    int val;
    TNode *left;
    TNode *right;
};
#endif //BINARY_TREE

#define LNTYPE TNode *
#include "../myList/myList.h"

typedef struct {
    MyList *bTIList;
    void (*extBTIList)(MyList *bTIList, LNTYPE next);
    LNTYPE (*extLinker)(LNTYPE pre);
}BTI;



BTI *createBTIt(LNTYPE root, void (*extBTIList)(MyList *bTIList, LNTYPE next), LNTYPE (*extLinker)(LNTYPE pre));

void myBTItFree(BTI *bTIt);

int bTIthasNext(BTI *bTIP);

LNTYPE bTItNext(BTI *bTIP);

void LExtBTIList(MyList *bTIList, LNTYPE next);
LNTYPE l2rExtL(LNTYPE pre);

void RExtBTIList(MyList *bTIList, LNTYPE next);
LNTYPE r2lExtL(LNTYPE pre);

#endif //B_T_ITERATOR
